#!/bin/bash
module load afni
for id in $(seq -w 1 20)
do
targetdir=/ibmgpfs/cuizaixu_lab/lizhilin/tPBM_5/data/anat/sub-0${id}/mri

cd ${targetdir}
rm all_labels.nii
rm Tissue.nii
3dTcat -prefix all_labels.nii p6* p1* p2* p3* p4* p5*
3dTstat -argmax -prefix Tissue.nii all_labels.nii
	
echo "sub-${id} is OK!"
done
